<template>
  <div class="rating-detail-container">
    <el-table :data="listData" v-loading="loading">
      <template #empty>
        <Empty />
      </template>
      <el-table-column
          type="index"
          label="序号"
          width="100">
      </el-table-column>
      <el-table-column
          prop="majorItem"
          label="指标项">
      </el-table-column>
      <el-table-column
          prop="minorItem"
          label="标签">
      </el-table-column>
      <el-table-column
          prop="itemScore"
          label="分数">
      </el-table-column>
      <el-table-column
          prop="itemDesc"
          label="描述">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
const mockData = [
  {
    majorItem: '攻击攻击',
    minorItem: '测试，木马',
    itemScore: '99',
    itemDesc: '没什么小数目'
  }
]
import Empty from "@/components/Empty.vue";
export default {
  name: "RatingDetail",
  components:{Empty},
  props: {
    viewName: {
      type: String,
      required: true,
    },
    viewType: {
      type: Number,
      required: true,
    },
    datePickerValue: {
      type: Array,
      default: function () {
        return []
      }
    },
  },
  data() {
    return {
      loading: true,
      paging: 1,
      limit: 5,
      total: 0,
      listData: [],
    }
  },
  created() {
    this.initComp();
  },
  methods: {
    initComp() {
      this.getDataList();
    },
    getDataList() {
      const params = {
        startTime: this.datePickerValue[0],
        endTime: this.datePickerValue[1],
        viewType: this.viewType,
        startPosition: this.limit * (this.paging - 1),
        maxResult: this.limit,
      }
      console.log(params);
      this.formatData(mockData);
    },
    formatData(data){
      this.listData = data
      this.loading = false;
    }
  }
}
</script>

<style scoped lang="scss">
.rating-detail-container {

}
</style>